-
Notifications
You must be signed in to change notification settings - Fork 8
Add Pulsar Admin MCP server implementation with HTTP/STDIO transport and 70 tool commands #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Change Chinese to English
|
@Zhianii It is not necessary to upload the |
|
@Zhianii please use english commit messages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a Model Context Protocol (MCP) server for Apache Pulsar Admin operations, enabling AI assistants to manage Pulsar clusters through natural language. The implementation provides both HTTP and STDIO transport modes and exposes 70 administrative tool commands across cluster, tenant, namespace, topic, subscription, message, schema, and monitoring categories.
Key changes:
- New
pulsar-admin-mcp-contribmodule with MCP server implementations supporting HTTP streaming and STDIO transports - 70 tool commands covering comprehensive Pulsar admin operations organized into 8 functional categories
- Lifecycle management through
PulsarClientManagerwith thread-safe lazy initialization for PulsarAdmin and PulsarClient
Reviewed Changes
Copilot reviewed 31 out of 33 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| pom.xml | Adds pulsar-admin-mcp-contrib module to parent POM |
| pulsar-admin-mcp-contrib/pom.xml | Maven configuration with MCP SDK, Pulsar client dependencies and Spring Boot setup |
| pulsar-admin-mcp-contrib/src/main/java/org/apache/pulsar/admin/mcp/Main.java | Application entry point that parses CLI options and launches transport layer |
| pulsar-admin-mcp-contrib/src/main/java/org/apache/pulsar/admin/mcp/client/PulsarClientManager.java | Manages PulsarAdmin and PulsarClient lifecycle with thread-safe initialization |
| pulsar-admin-mcp-contrib/src/main/java/org/apache/pulsar/admin/mcp/config/PulsarMCPCliOptions.java | CLI options parser supporting transport type and port configuration |
| pulsar-admin-mcp-contrib/src/main/java/org/apache/pulsar/admin/mcp/transport/*.java | Transport layer implementations for HTTP and STDIO modes with tool registration |
| pulsar-admin-mcp-contrib/src/main/java/org/apache/pulsar/admin/mcp/tools/*.java | Tool implementations for cluster, tenant, namespace, topic, subscription, message, schema, and monitoring operations |
| pulsar-admin-mcp-contrib/src/main/resources/application.yml | Spring Boot configuration for MCP server, Pulsar connections, and feature flags |
| pulsar-admin-mcp-contrib/README.md | Comprehensive documentation with quick start guide, configuration examples, and usage demos |
| pcip/picp-6.md | PCIP proposal document describing architecture and design decisions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
pulsar-admin-mcp-contrib/src/main/java/org/apache/pulsar/admin/mcp/tools/BasePulsarTools.java
Outdated
Show resolved
Hide resolved
pulsar-admin-mcp-contrib/src/main/java/org/apache/pulsar/admin/mcp/tools/ClusterTools.java
Outdated
Show resolved
Hide resolved
pulsar-admin-mcp-contrib/src/main/java/org/apache/pulsar/admin/mcp/tools/ClusterTools.java
Outdated
Show resolved
Hide resolved
pulsar-admin-mcp-contrib/src/main/java/org/apache/pulsar/admin/mcp/tools/TopicTools.java
Outdated
Show resolved
Hide resolved
pulsar-admin-mcp-contrib/src/main/java/org/apache/pulsar/admin/mcp/tools/MessageTools.java
Outdated
Show resolved
Hide resolved
pulsar-admin-mcp-contrib/src/main/java/org/apache/pulsar/admin/mcp/tools/NamespaceTools.java
Outdated
Show resolved
Hide resolved
pulsar-admin-mcp-contrib/src/main/java/org/apache/pulsar/admin/mcp/tools/ClusterTools.java
Outdated
Show resolved
Hide resolved
pulsar-admin-mcp-contrib/src/main/java/org/apache/pulsar/admin/mcp/tools/ClusterTools.java
Outdated
Show resolved
Hide resolved
pulsar-admin-mcp-contrib/src/main/java/org/apache/pulsar/admin/mcp/Main.java
Show resolved
Hide resolved
pulsar-admin-mcp-contrib/src/main/java/org/apache/pulsar/admin/mcp/tools/BasePulsarTools.java
Outdated
Show resolved
Hide resolved
pulsar-admin-mcp-contrib/src/main/java/org/apache/pulsar/admin/mcp/tools/MessageTools.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 37 out of 39 changed files in this pull request and generated 17 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes #PCIP-6 Implement the MCP for Pulsar Admin Tool
Main Issue: #PCIP-6 Implement the MCP for Pulsar Admin Tool
Motivation
This PR introduces the MCP (Model Context Protocol) server implementation for Pulsar Admin operations.
The motivation is to enable AI assistants (such as Claude Desktop) to interact with Apache Pulsar clusters using natural language.
Through MCP, Pulsar administration capabilities are exposed via a standardized protocol, improving automation and intelligent integration.
Modifications
StdioMCPServerandHttpMCPServer, supporting STDIO and HTTP Streaming transportsPulsarAdminandPulsarClient, with lazy initialization and thread safetyVerifying this change
pulsar://localhost:6650,http://localhost:8080)/mcplist-tenants,create-namespace,get-topic-stats, etc.(This change has been tested through new integration tests and validated against a real Pulsar cluster.)